/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kungkhies.common.services.kungkhie.validate.xml;

import com.kungkhies.common.services.kungkhie.parse.KungkhieParseService;
import com.kungkhies.xml.schema.kungkhie.ArcListType;
import com.kungkhies.xml.schema.kungkhie.ArcType;
import com.kungkhies.xml.schema.kungkhie.IloListType;
import com.kungkhies.xml.schema.kungkhie.IloType;
import com.kungkhies.xml.schema.kungkhie.KungkhieDocument;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author clayton
 */
public class KungkhieXmlValidateServiceImplTest_TagList
{
    public KungkhieXmlValidateServiceImplTest_TagList()
    {
    }

    @BeforeClass
    public static void setUpClass()
    {
    }

    @AfterClass
    public static void tearDownClass()
    {
    }

    @Before
    public void setUp()
    {
    }

    @After
    public void tearDown()
    {
    }

    /**
     * Test of validateKungkhieType method, of class
     * KungkhieXmlValidateServiceImpl.
     */
    @Test
    public void testValidateKungkhieTagList_Cardinality() throws Exception
    {
        System.out.println("validateKungkhieTagList_Cardinality");
        KungkhieDocument kungkhieDocument = null;
        KungkhieXmlValidateServiceImpl instance = new KungkhieXmlValidateServiceImpl();
        String pathToFile = "resources/example-kungkhie-1.xml";
        String filename = "validateContent.txt";
        kungkhieDocument = instance.createKungkhieDocument(pathToFile, filename);

        String[] tagArray = kungkhieDocument.getKungkhie().getTagList().getTagArray();


        int tagArrayCardinalityActual = tagArray.length;

        int tagArrayCardinalityExpected = 3;

        assertEquals(tagArrayCardinalityExpected, tagArrayCardinalityActual);
    }
    
    /**
     * Test of validateKungkhieType method, of class
     * KungkhieXmlValidateServiceImpl.
     */
    @Test
    public void testValidateKungkhieTagList_Values() throws Exception
    {
        System.out.println("validateKungkhieTagList_Cardinality");
        KungkhieDocument kungkhieDocument = null;
        KungkhieXmlValidateServiceImpl instance = new KungkhieXmlValidateServiceImpl();
        String pathToFile = "resources/example-kungkhie-1.xml";
        String filename = "validateContent.txt";
        kungkhieDocument = instance.createKungkhieDocument(pathToFile, filename);

        String[] tagArray = kungkhieDocument.getKungkhie().getTagList().getTagArray();

        String tag1Expected = "tag1";
        String tag2Expected = "tag2";
        String tag3Expected = "tag3";
        
        String tag1Actual = tagArray[0];
        String tag2Actual = tagArray[1];
        String tag3Actual = tagArray[2];
        

        assertEquals(tag1Expected, tagArray[0]);
        assertEquals(tag2Expected, tagArray[1]);
        assertEquals(tag3Expected, tagArray[2]);
    }

    
}
